import http from './http.js'

// 点赞
export const postLikePost =(params) =>{
	return http.put(`/Forum/LikePost?userToken=${uni.getStorageSync('openId')|| getApp().globalData.openId}&postId=${params.postId}`)
}
// 发帖列表
export const getForumPosts =(params) =>{
	return http.get(`/Forum/Posts?userToken=${uni.getStorageSync('openId')|| getApp().globalData.openId}`,params)
}
// 查询评论
export const getForumComments =() =>{
	return http.get(`/Forum/Comments?userToken=${uni.getStorageSync('openId')|| getApp().globalData.openId}`)
}
// 发布帖子
export const postPublishPost =(params) =>{
	return http.post(`/Forum/PublishPost?userToken=${uni.getStorageSync('openId')|| getApp().globalData.openId}`,params)
}
// 上传图片
export const postUploadImage =(params) =>{
	return http.post(`/Forum/UploadImage?type=${params.type}&imageName=${params.imageName}`)
}
// 删除图片
export const delUploadImage =(params) =>{
	return http.delete(`/Forum/RemoveImage?type=${params.type}&imageName=${params.imageName}`)
}

